www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\admin\adminModelComponentLabel\D_ajax_update_label_to_mdb_from_files_by_step.asp

    <%


'**************************************************************
' 新动软网站管理系统
' 官方网站: http://www.aspcpu.com
' 系统作者: 阮丁远(网名:天下程序)
' Copyright 新动软网站管理系统 版权所有
'**************************************************************


%>









<%

dir_set="../../"


%>


<!--#include file=../../inc/conn.asp-->






<!--#include file=../inc/checkadmin2.asp-->

<!--#include file=../../inc/functionFiless.asp-->



<!--#include file=../../inc/ND_class_function.asp-->



<!--#include file=conn_m.asp-->


<%

set filea=new Cls_FSO
set fileb=new DosAsp 



'15,不用再改
per=15



ended=0


if request("pos")="" then






conn2.execute("delete from ND_label_cachem")




Const JET_3X = 4

Function CompactDB(dbPath, boolIs97)

'-------------------new code1--------------------
'重要
on error resume next
'-------------------new code1--------------------


Dim fso, Engine, strDBPath
strDBPath = left(dbPath,instrrev(DBPath,""))


Set fso = CreateObject(fssoo_nd_var_str_x_customx)



'-------------------new code2--------------------
if fso.FileExists(strDBPath & "temp.mdb") then
fso.DeleteFile(strDBPath & "temp.mdb")
end if
'-------------------new code2--------------------




If fso.FileExists(dbPath) Then
Set Engine = CreateObject("JRO.JetEngine")

If boolIs97 = "True" Then
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
Else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb"
End If
fso.CopyFile strDBPath & "temp.mdb",dbpath
fso.DeleteFile(strDBPath & "temp.mdb")
Set fso = nothing
Set Engine = nothing
CompactDB = "你的数据库 " & dbpath & " 已经压缩完毕" & vbCrLf
Else
CompactDB = "The database name or path has not been found. Try Again" & vbCrLf
End If

End Function



    If IsObject(conn2) Then
        conn2.Close
        Set conn2 = Nothing
    End If

call CompactDB(Server.MapPath(dir_set&nd_mdcach_mdb), "-1")



call OpenConn2()





sql=""
else

sql=" where id>"&request("pos")

end if


%>



<%

set rs1=server.CreateObject("adodb.recordset")
       
rs1.open "select * from ND_label_list_cachem "&sql&" order by id asc",conn2,1,1



for iggfg=1 to per
if rs1.eof then

ended=1
exit for

end if

now_pos1=rs1("id")


path1=rs1("label_full_path_filename")
if rs1("is_sys")="0" then

ppath="Model/ComponentLabels/"

else

ppath="Model/ComponentLabels/"
end if


cont11=loadfile("../../"&ppath&path1)

call get_info_array_from_label_file_content(cont11)




'response.write "type:"&nd1_label_type&"<br>"
'response.write "name:"&nd1_l_name&"<br>"
'response.write "sql:"&nd1_label_sql&"<br>"
'response.write "params:"&nd1_label_params&"<br>"
'response.write "fenye:"&nd1_label_fenye_num&"<br>"
'response.write "beizhu:"&nd1_label_beizhu&"<br>"
'response.write "other_params:"&nd1_other_params&"<br>"
'response.write "is_sys:"&nd1_is_sys_label&"<br>"
'response.write  nd1_label_code


set rs4=server.CreateObject("adodb.recordset")
       
rs4.open "select * from ND_label_cachem",conn2,1,3

rs4.addnew


'--------------------------

if lcase(nd1_l_name)="$addmode$-componentlabel-$" then

path1_p=split(path1,"/")
path2=""
for iaaa=0 to ubound(path1_p)-1
path2=path2&path1_p(iaaa)&"/"
next


sss1=loadfile("../../Model/ComponentLabels/"&path2&"index_componentlabel.asp")
	
if instr(1,sss1,"$componentlabelname:",1)<>0 then
nd1_m_label_name=trim(mid(sss1,instr(1,sss1,"$componentlabelname:",1)+20,instr(1,sss1,"$end_componentlabelname",1)-(instr(1,sss1,"$componentlabelname:",1)+20)))
else
nd1_m_label_name=""
end if

if instr(1,sss1,"$componentlabelcixu:",1)<>0 then
nd1_m_label_cixu=trim(mid(sss1,instr(1,sss1,"$componentlabelcixu:",1)+20,instr(1,sss1,"$end_componentlabelcixu",1)-(instr(1,sss1,"$componentlabelcixu:",1)+20)))
else
nd1_m_label_cixu=""
end if
if instr(1,sss1,"$is_sys_componentlabel:",1)<>0 then
nd1_m_label_is_sys=trim(mid(sss1,instr(1,sss1,"$is_sys_componentlabel:",1)+23,instr(1,sss1,"$end_is_sys_componentlabel",1)-(instr(1,sss1,"$is_sys_componentlabel:",1)+23)))
else
nd1_m_label_is_sys=""
end if

nd1_l_name=nd1_m_label_name&"$addmode$"

end if

'--------------------------

if lcase(nd1_l_name)="$editmode$-componentlabel-$" then

path1_p=split(path1,"/")
path2=""
for iaaa=0 to ubound(path1_p)-1
path2=path2&path1_p(iaaa)&"/"
next


sss1=loadfile("../../Model/ComponentLabels/"&path2&"index_componentlabel.asp")
	
if instr(1,sss1,"$componentlabelname:",1)<>0 then
nd1_m_label_name=trim(mid(sss1,instr(1,sss1,"$componentlabelname:",1)+20,instr(1,sss1,"$end_componentlabelname",1)-(instr(1,sss1,"$componentlabelname:",1)+20)))
else
nd1_m_label_name=""
end if

if instr(1,sss1,"$componentlabelcixu:",1)<>0 then
nd1_m_label_cixu=trim(mid(sss1,instr(1,sss1,"$componentlabelcixu:",1)+20,instr(1,sss1,"$end_componentlabelcixu",1)-(instr(1,sss1,"$componentlabelcixu:",1)+20)))
else
nd1_m_label_cixu=""
end if
if instr(1,sss1,"$is_sys_componentlabel:",1)<>0 then
nd1_m_label_is_sys=trim(mid(sss1,instr(1,sss1,"$is_sys_componentlabel:",1)+23,instr(1,sss1,"$end_is_sys_componentlabel",1)-(instr(1,sss1,"$is_sys_componentlabel:",1)+23)))
else
nd1_m_label_is_sys=""
end if

nd1_l_name=nd1_m_label_name&"$editmode$"

end if


'--------------------------

if lcase(nd1_l_name)="$showmode$-componentlabel-$" then

path1_p=split(path1,"/")
path2=""
for iaaa=0 to ubound(path1_p)-1
path2=path2&path1_p(iaaa)&"/"
next


sss1=loadfile("../../Model/ComponentLabels/"&path2&"index_componentlabel.asp")
	
if instr(1,sss1,"$componentlabelname:",1)<>0 then
nd1_m_label_name=trim(mid(sss1,instr(1,sss1,"$componentlabelname:",1)+20,instr(1,sss1,"$end_componentlabelname",1)-(instr(1,sss1,"$componentlabelname:",1)+20)))
else
nd1_m_label_name=""
end if

if instr(1,sss1,"$componentlabelcixu:",1)<>0 then
nd1_m_label_cixu=trim(mid(sss1,instr(1,sss1,"$componentlabelcixu:",1)+20,instr(1,sss1,"$end_componentlabelcixu",1)-(instr(1,sss1,"$componentlabelcixu:",1)+20)))
else
nd1_m_label_cixu=""
end if
if instr(1,sss1,"$is_sys_componentlabel:",1)<>0 then
nd1_m_label_is_sys=trim(mid(sss1,instr(1,sss1,"$is_sys_componentlabel:",1)+23,instr(1,sss1,"$end_is_sys_componentlabel",1)-(instr(1,sss1,"$is_sys_componentlabel:",1)+23)))
else
nd1_m_label_is_sys=""
end if

nd1_l_name=nd1_m_label_name&"$showmode$"

end if






'--------------------------

if lcase(nd1_l_name)="$doaddmode$-componentlabel-$" then

path1_p=split(path1,"/")
path2=""
for iaaa=0 to ubound(path1_p)-1
path2=path2&path1_p(iaaa)&"/"
next


sss1=loadfile("../../Model/ComponentLabels/"&path2&"index_componentlabel.asp")
	
if instr(1,sss1,"$componentlabelname:",1)<>0 then
nd1_m_label_name=trim(mid(sss1,instr(1,sss1,"$componentlabelname:",1)+20,instr(1,sss1,"$end_componentlabelname",1)-(instr(1,sss1,"$componentlabelname:",1)+20)))
else
nd1_m_label_name=""
end if

if instr(1,sss1,"$componentlabelcixu:",1)<>0 then
nd1_m_label_cixu=trim(mid(sss1,instr(1,sss1,"$componentlabelcixu:",1)+20,instr(1,sss1,"$end_componentlabelcixu",1)-(instr(1,sss1,"$componentlabelcixu:",1)+20)))
else
nd1_m_label_cixu=""
end if
if instr(1,sss1,"$is_sys_componentlabel:",1)<>0 then
nd1_m_label_is_sys=trim(mid(sss1,instr(1,sss1,"$is_sys_componentlabel:",1)+23,instr(1,sss1,"$end_is_sys_componentlabel",1)-(instr(1,sss1,"$is_sys_componentlabel:",1)+23)))
else
nd1_m_label_is_sys=""
end if

nd1_l_name=nd1_m_label_name&"$doaddmode$"

end if





'--------------------------

if lcase(nd1_l_name)="$doeditmode$-componentlabel-$" then

path1_p=split(path1,"/")
path2=""
for iaaa=0 to ubound(path1_p)-1
path2=path2&path1_p(iaaa)&"/"
next


sss1=loadfile("../../Model/ComponentLabels/"&path2&"index_componentlabel.asp")
	
if instr(1,sss1,"$componentlabelname:",1)<>0 then
nd1_m_label_name=trim(mid(sss1,instr(1,sss1,"$componentlabelname:",1)+20,instr(1,sss1,"$end_componentlabelname",1)-(instr(1,sss1,"$componentlabelname:",1)+20)))
else
nd1_m_label_name=""
end if

if instr(1,sss1,"$componentlabelcixu:",1)<>0 then
nd1_m_label_cixu=trim(mid(sss1,instr(1,sss1,"$componentlabelcixu:",1)+20,instr(1,sss1,"$end_componentlabelcixu",1)-(instr(1,sss1,"$componentlabelcixu:",1)+20)))
else
nd1_m_label_cixu=""
end if
if instr(1,sss1,"$is_sys_componentlabel:",1)<>0 then
nd1_m_label_is_sys=trim(mid(sss1,instr(1,sss1,"$is_sys_componentlabel:",1)+23,instr(1,sss1,"$end_is_sys_componentlabel",1)-(instr(1,sss1,"$is_sys_componentlabel:",1)+23)))
else
nd1_m_label_is_sys=""
end if

nd1_l_name=nd1_m_label_name&"$doeditmode$"

end if




'-------------------------------------------


rs4("label_code")=nd1_label_code
rs4("label_name")=nd1_l_name
rs4("label_full_path_name")=trim(ppath&path1)
rs4("label_params")=nd1_label_params
rs4("label_type")=nd1_label_type
rs4("label_sql")=nd1_label_sql
rs4("label_fenye_num")=nd1_label_fenye_num
rs4("label_beizhu")=nd1_label_beizhu
rs4("is_sys_label")=rs1("is_sys")
rs4("label_other_params")=nd1_other_params


rs4.update

rs4.close

set rs4=nothing

rs1.movenext



next

rs1.close
set rs1=nothing





response.ContentType="text/xml"

response.write "<?xml   version=""1.0""   encoding=""gb2312""?>"

response.write "<aaaa>"
response.write "<affff><![CDATA["&ended
response.write "]]></affff><affff2><![CDATA["&now_pos1&"]]></affff2><affff5><![CDATA["&left((path1),35)&"]]></affff5></aaaa>"




















%>